﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;
using QLab.Model;

namespace QLab.Services
{
	[Export(typeof(ICommandHistoryService))]
	[PartCreationPolicy(CreationPolicy.Shared)]
	public class CommandHistoryService : ICommandHistoryService
	{
		private CommandHistoryModel _commands;

		[ImportingConstructor]
		public CommandHistoryService()
		{
			_commands = new CommandHistoryModel();
		}

		#region Methods

		public CommandIterator CreateIterator()
		{
			return _commands.CreateIterator();
		}

		public void LogCommand(string CommandText)
		{
			_commands.AddCommand(CommandText);
		}

		public void ClearCommands()
		{
			_commands.ClearCommands();
		}

		#endregion


	}
}
